IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spTdoctypes_Create')
	BEGIN
		PRINT 'Dropping Procedure spTdoctypes_Create'
		DROP  Procedure  spTdoctypes_Create
	END

GO

PRINT 'Creating Procedure spTdoctypes_Create'
GO
CREATE Procedure dbo.spTdoctypes_Create
	( 	  
	  @mandatory bit = null, 
		@useqc bit = null, 
		@initreq int = null, 
		@dispseq int = null, 
		@tooltip varchar(100) = null, 
		@barcode char(20) = null, 
		@istd bit = null, 
		@ismb bit = null, 
		@isrelease bit = null, 
		@containername varchar(50) = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 8/22/2007    Initial version created
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Create the required new record
	INSERT INTO Tdoctypes
	  (
		mandatory,
			useqc,
			initreq,
			dispseq,
			tooltip,
			barcode,
			istd,
			ismb,
			isrelease,
			containername	  
	  )
	VALUES
	  (
		@mandatory,
			@useqc,
			@initreq,
			@dispseq,
			@tooltip,
			@barcode,
			@istd,
			@ismb,
			@isrelease,
			@containername
	  )

	-- Handle any errors
	IF @@ERROR != 0
	BEGIN
		RAISERROR('spTdoctypes_Create: Unable to Insert a new Tdoctypes', 10, 1)
		RETURN
	END

	-- Return the newly created ID
	SELECT	@@IDENTITY AS 'Tdoctypes_ID'

	-- Return to calling method
	RETURN 

GO
